import request from './http';

const BASE_URL = window.ENV?.TASK_API || '';

const BASE_URL_DOWNLOAD = BASE_URL + '/file/'

export default {
    BASE_URL,
    BASE_URL_DOWNLOAD,
    baseInfoDetail() {
        return request.requestPost(BASE_URL + '/api/pc/baseInfo/detail')
    },
    editBaseInfoDetail(dto) {
        return request.requestPost(BASE_URL + '/api/admin/baseInfo/edit', dto)
    },
    importExcelToTable(dto, tableName) {
        return request.requestPost(BASE_URL + '/api/admin/dj/importExcelToTable?tableName=' + tableName, dto)
    },
    getTableInfo(tableName) {
        return request.requestPost(BASE_URL + '/api/admin/dj/tableInfo?tableName=' + tableName)
    },
    deleteElement(tableName, id) {
        return request.requestPost(BASE_URL + '/api/admin/dj/delete?tableName=' + tableName + "&id=" + id)
    },
    groupInfoDetail() {
        return request.requestPost(BASE_URL + '/api/admin/dj/groupInfo')
    },
    editGroupInfoDetail(dto) {
        return request.requestPost(BASE_URL + '/api/admin/dj/edit', dto)
    },
    addAddressBook(dto) {
        return request.requestPost(BASE_URL + "/api/admin/address_book/add", dto)
    },
    addressBookDetail(id) {
        return request.requestPost(BASE_URL + '/api/admin/address_book/detail?id=' + id)
    },
    addressBookList() {
        return request.requestPost(BASE_URL + '/api/admin/address_book/list')
    },
    deleteAddressBook(id) {
        return request.requestPost(BASE_URL + '/api/admin/address_book/delete?id=' + id)
    },
    addNotice(dto) {
        return request.requestPost(BASE_URL + '/api/admin/notice/add', dto)
    },
    noticeList() {
        return request.requestPost(BASE_URL + '/api/pc/notice/list')
    },
    noticeDelete(id) {
        return request.requestPost(BASE_URL + '/api/admin/notice/delete?id=' + id)
    },
    ossFile(file) {
        return request.requestPost(BASE_URL + '/api/admin/ex/oss', file)
    },
    addUser(obj) {
        return request.requestPost(BASE_URL + '/user/add', obj)
    },
    addLog(obj) {
        return request.requestPost(BASE_URL + '/log/add', obj)
    },
    dirSelect(data) {
        return request.requestPost(BASE_URL + '/dir/list-select',data)
    }
}